package com.xr.miniprogram.controller.service;

import com.xr.common.core.domain.AjaxResult;
import com.xr.miniprogram.domain.MiniProgramStandards;
import com.xr.common.core.controller.BaseController;
import com.xr.miniprogram.domain.vo.MiniProgramStandardsVO;
import com.xr.miniprogram.service.IMiniProgramStandardsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


@Api("小程序服务规格控制")
@RestController
@RequestMapping("/miniprogram/standards")
public class MiniProgramStandardsController extends BaseController{
    @Resource
    public IMiniProgramStandardsService miniProgramStandardsService;

    /**
     * 根据服务详情id获取服务规格列表
     * @param serviceId
     * @return list
     */
    @ApiOperation("根据服务详情id获取服务规格列表")
    @GetMapping(value = "/list")
    public AjaxResult list(@ApiParam(value = "服务id", required = true) @RequestParam("serviceId") Long serviceId)
    {
        return success(MiniProgramStandardsVO.toMiniProgramStandardsVOList(miniProgramStandardsService.getStandardsListByServiceId(serviceId)));
    }
}
